//package com.haiyou.dc.es;
//
//import org.elasticsearch.client.transport.TransportClient;
//import org.elasticsearch.common.settings.Settings;
//import org.elasticsearch.common.transport.InetSocketTransportAddress;
//import org.elasticsearch.transport.client.PreBuiltTransportClient;
//
//import java.net.InetAddress;
//import java.net.UnknownHostException;
//
//public class TestEsBase {
//
//    protected static TransportClient client;
//
//    public static void start() {
//        Settings settings = Settings.builder()
//                .put("cluster.name", "my-elsticsearch")
//                .build();
//        client = new PreBuiltTransportClient(settings);
//        try {
//            client.addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName("127.0.0.1"), 9301));
//            client.addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName("127.0.0.1"), 9302));
//            client.addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName("127.0.0.1"), 9303));
//        } catch (UnknownHostException e) {
//            e.printStackTrace();
//        }
//
//    }
//
//    public static void close() {
//       client.close();
//    }
//
//}
